%%Two Players -- Rock, Scissors, Paper
function ex_RPS
P1=newplayer(...
'legend','ro-',...
'info','P_{1}',...
'motion','step_func',...
'step_func','RPS_step_player',...
'draw_player_func','RPS_draw_player',...
'draw_player_trace_func',''...
)
P1.action=0;P1.score=10;P1.Vars=[P1.action,P1.score];
%P1.plot_labels={'P1.action','P1.score'};P1.plot_components=[2];
P2=newplayer(...
'legend','b*-',...
'info','P_{2}',...
'motion','step_func',...
'step_func','RPS_step_player',...
'draw_player_func','RPS_draw_player',...
'draw_player_trace_func',''...
)
P2.action=0;P2.score=10;P2.Vars=[P2.action,P2.score];
%P2.plot_labels={'P2.action','P2.score'};P2.plot_components=[2];
G=newgame({P1,P2},...
'max_step',10,...
'axis',[0,1,0,1],...
'pause','pause;',...
'draw',2,...
'legend2',['o','*'],...
'plot_components',[2],...
'draw_game_board_func','RPS_draw_board',...
'draw_game_trace_func','RPS_draw_game_trace',...
'before_draw_func','RPS_show_info'...
)
G=simgame(G)

